import React, { Component } from 'react';
import '../styles/Entry.scss'
import * as service from '../api/index'

class Entry extends Component {
    state={
        entrylist:[]
    }
    async componentDidMount(){
        let res = await service.index_nav()
        // console.log(res.data.list);
        this.setState({entrylist:res.data.list})
    }
    render() {
        return (
            <div className='entry'>
                {
                    this.state.entrylist.length !=0?
                    this.state.entrylist.map((item,index)=>{
                        return (
                            <div className="item">
                                <img src={item.pic} alt="" />
                                <div className="name">
                                    {item.name}
                                </div>
                            </div>
                        )
                    }):
                    <></>
                }
            </div>
        );
    }
}

export default Entry;